<template>
  <dev>
    <h2>命名路由</h2>
    <h3>1、常规通过vue-link跳转</h3>
    <router-link to="/">
      <el-button type="primary">首页</el-button>
    </router-link>

    <h3>2、通过name跳转</h3>
    <router-link :to="{name: '常用指令' }">跳转</router-link>

    <h3>3、通过push跳转</h3>
    <el-button type=“primary” @click="push()">push跳转</el-button>

    <h2>命名视图</h2>
    <h3>1、默认视图</h3>
    <router-view></router-view>
    <h3>2、多个视图组件</h3>
  </dev>

</template>


<script>
export default {
  name: 'router',
  data () {
    return {

    }
  },
  methods: {
    push () {
      //   this.$router.push({
      //     name: '常用指令'
      //   })
      this.$router.push({ path: '/' });
    }
  }
}
</script>

<style>
</style>